<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class FilehandlerComponent</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> FilehandlerComponent</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Componente para manejar y administrar archivos</p>
<p class="description"><p>Permite  <ul><li>Subir fotos</li><li>Subir Archivos especificados en los formatos permitidos</li><li>Eliminar fotos</li></ul></p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Luis Gabriel Rodriguez &lt;<a href="mailto:luisgabriel84@gmail.com">luisgabriel84@gmail.com</a>&gt;</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_controllers---components---filehandler.php.html">/controllers/components/filehandler.php</a> (line <span class="field">18</span>)
		</p>
		
				
		<pre>Object
   |
   --FilehandlerComponent</pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">array</span>
					<a href="#$documentFormats" title="details" class="var-name">$documentFormats</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">array</span>
					<a href="#$pictureFormats" title="details" class="var-name">$pictureFormats</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																								<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#clean_image_name" title="details" class="method-name">clean_image_name</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#deleteFile" title="details" class="method-name">deleteFile</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$location</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$file</span>, [<span class="var-type">bool</span>&nbsp;<span class="var-name">$thumb</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getFileType" title="details" class="method-name">getFileType</a>
											([<span class="var-type">Nombre</span>&nbsp;<span class="var-name">$file</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#resize_img" title="details" class="method-name">resize_img</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$imgname</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$size</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#slug" title="details" class="method-name">slug</a>
											(<span class="var-type">$string</span>&nbsp;<span class="var-name">$string</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string|bool</span>
										<a href="#uploadpicture" title="details" class="method-name">uploadpicture</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$folder</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$picture</span> = <span class="var-default">null</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$widthLargeImage</span> = <span class="var-default">false</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$widthThumb</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">string|bool</span>
										<a href="#upload_single_file" title="details" class="method-name">upload_single_file</a>
											(<span class="var-type">folder</span>&nbsp;<span class="var-name">$folder</span>, <span class="var-type">archivo</span>&nbsp;<span class="var-name">$archivo_file</span>)
									</div>
											</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			
<a name="var$documentFormats" id="$documentFormats"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$documentFormats</span>
			 = <span class="var-default">array('doc','pdf','xls','ppt','zip','rar','gz','swf','fla','psd')</span>			(line <span class="line-number">30</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> formatos de archivos permitidos</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$pictureFormats" id="$pictureFormats"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$pictureFormats</span>
			 = <span class="var-default">array('jpg', 'png','gif','bmp','jpeg')</span>			(line <span class="line-number">25</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> formatos de imagen permitidos</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
														<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodclean_image_name" id="clean_image_name"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">clean_image_name</span> (line <span class="line-number">264</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Borra los caracteres especiales del nombre de una imagen</p>
	<ul class="tags">
				<li><span class="field">return:</span> Nombre de la imagen sin caracteres</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			clean_image_name
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: Nombre de la imagen</span>			</li>
				</ul>
		
			
	</div>
<a name="methoddeleteFile" id="deleteFile"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">deleteFile</span> (line <span class="line-number">177</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Elimina un archivo</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			deleteFile
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$location</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$file</span>, [<span class="var-type">bool</span>&nbsp;<span class="var-name">$thumb</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$location</span><span class="var-description">: Folder donde se encuentra el archivo</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$file</span><span class="var-description">: Nombre del archivo a eliminar</span>			</li>
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$thumb</span><span class="var-description">: Si el archivo es una foto y tiene imagen en miniatura; establecer a  true para que sea elininada tambien buscara en la carpeta 'thumbs'  Ejemplos:  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">Filehandler</span><span class="src-sym">-&gt;</span><a href="../default/FilehandlerComponent.html#methoddeleteFile">deleteFile</a><span class="src-sym">(</span><span class="src-str">'img/productos'</span><span class="src-sym">,</span><span class="src-str">'foto.jpg'</span><span class="src-sym">,</span><span class="src-id">true</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol></div></span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetFileType" id="getFileType"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">getFileType</span> (line <span class="line-number">97</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Obtiene la extension de un archivo</p>
	<ul class="tags">
				<li><span class="field">return:</span> Extencion del archivo</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getFileType
		</span>
					([<span class="var-type">Nombre</span>&nbsp;<span class="var-name">$file</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">Nombre</span>
				<span class="var-name">$file</span><span class="var-description">: del archivo</span>			</li>
				</ul>
		
			
	</div>
<a name="methodresize_img" id="resize_img"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">resize_img</span> (line <span class="line-number">202</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Redimensiona una imagen al ancho especificado</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			resize_img
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$imgname</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$size</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$filename</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$imgname</span><span class="var-description">: Nombre que se le va a dar al la imagen</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$size</span><span class="var-description">: Nuevo ancho de la imagen</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$filename</span><span class="var-description">: Nombre del archivo</span>			</li>
				</ul>
		
			
	</div>
<a name="methodslug" id="slug"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">slug</span> (line <span class="line-number">39</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Convierte una palabra en url amigable</p>
	<ul class="tags">
				<li><span class="field">return:</span> convertida (slug)</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			slug
		</span>
					(<span class="var-type">$string</span>&nbsp;<span class="var-name">$string</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">$string</span>
				<span class="var-name">$string</span><span class="var-description">: string a convertir en url</span>			</li>
				</ul>
		
			
	</div>
<a name="methoduploadpicture" id="uploadpicture"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">uploadpicture</span> (line <span class="line-number">126</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sube una foto</p>
	<ul class="tags">
				<li><span class="field">return:</span> Si logra subir la foto retorna el nombre que genero sino retorna falso</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string|bool</span>
		<span class="method-name">
			uploadpicture
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$folder</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$picture</span> = <span class="var-default">null</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$widthLargeImage</span> = <span class="var-default">false</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$widthThumb</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$folder</span><span class="var-description">: Folder de destino</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$picture</span><span class="var-description">: Nombre archivo</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$widthLargeImage</span><span class="var-description">: Ancho de la nueva imagen</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$widthThumb</span><span class="var-description">: Ancho de la imagen miniatura si no se especifica no se crea</span>			</li>
				</ul>
		
			
	</div>
<a name="methodupload_single_file" id="upload_single_file"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">upload_single_file</span> (line <span class="line-number">56</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Subir un solo archivo</p>
	<ul class="tags">
				<li><span class="field">return:</span> Si logra subir la foto retorna el nombre que genero sino retorna falso</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string|bool</span>
		<span class="method-name">
			upload_single_file
		</span>
					(<span class="var-type">folder</span>&nbsp;<span class="var-name">$folder</span>, <span class="var-type">archivo</span>&nbsp;<span class="var-name">$archivo_file</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">folder</span>
				<span class="var-name">$folder</span><span class="var-description">: de destino</span>			</li>
					<li>
				<span class="var-type">archivo</span>
				<span class="var-name">$archivo_file</span><span class="var-description">: binario</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Mon, 08 Nov 2010 12:02:35 -0500 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>